<template>
<div>
  <FormTimer
    v-model="data.timePoint"
    :isEditAble="true"
    :readonly="true"
    label="时间点"
    labelWidth="90px"
    class="d-form-group-flex d-col-xs-6"
  ></FormTimer>
  <div class="d-form-group d-form-group-flex d-col-xs-6">
    <div class="d-form-label d-text-right">
      <label class="label-text">周期</label>
    </div>
    <div class="d-form-el">
      <div class="d-input-group">
        <input v-model="data.cycleTime" type="text" class="d-form-input" />
        <div class="d-input-group-btn">
          <select v-model="data.unit" class="d-form-select">
            <option v-for="item in unitList" :key="item.id" :value="item.id">{{ item.text }}</option>
          </select>
        </div>
      </div>
    </div>
  </div>
</div>
</template>

<script>
import { FormTimer } from '@daelui/vdog/dist/components'

export default {
  components: {
    FormTimer
  },

  props: {
    data: {
      type: Object,
      default () {
        return {
          type: ''
        }
      }
    }
  },

  data () {
    return {
      unitList: [
        {id: 'second', text: '秒'},
        {id: 'minute', text: '分'},
        {id: 'hour', text: '小时'},
        {id: 'day', text: '天'},
        {id: 'week', text: '周'},
        {id: 'month', text: '月'}
      ]
    }
  }
}
</script>

<style scoped>
.d-form-label {
  width: 90px;
}
.d-form-textarea {
  min-height: 120px;
}
</style>
